import {Table, Column, Model, DataType, ForeignKey, BelongsTo} from "sequelize-typescript";
import {Dynamic} from "./dynamic";

@Table({
    tableName: 'comment'
})
export class Comment extends Model<Comment> {
    @Column
    user_id!: string  // 用户id

    @Column
    user_name!: string // 用户姓名

    @Column
    user_picture!: string // 用户头像

    @Column
    content!: string  // 评论内容

    // @Column
    // dy_id!: string

    @Column({
        type: DataType.BIGINT({length: 20}),
    })
    created_at!: number

    @ForeignKey(() => Dynamic) @Column dy_id!:number
    @BelongsTo(()=>Dynamic) comment!: Dynamic
}
